Imports System.ComponentModel
Imports System.Web.UI

<ToolboxData("<{0}:FourthSample runat=server></{0}:FourthSample>")> Public Class FourthSample
    Inherits System.Web.UI.WebControls.WebControl
    Protected Overrides Sub CreateChildControls()
        Dim txt1 As New System.Web.UI.WebControls.TextBox
        Dim txt2 As New System.Web.UI.WebControls.TextBox
        Dim btn As New System.Web.UI.WebControls.Button

        txt1.Text = "Hello, "
        txt2.Text = "World "
        btn.Text = "Click Me"
        Me.Controls.Add(txt1)
        Me.Controls.Add(txt2)
        Me.Controls.Add(btn)

    End Sub
    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
        Dim ct As System.Web.UI.WebControls.WebControl

        For Each ct In Me.Controls
            If ct.GetType.Name <> "Button" Then
                ct.RenderControl(writer)
                writer.Write("<hr/>")
            End If
        Next

    End Sub
End Class
